﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ClientPostBack.aspx.cs" Inherits="PostBack_ClientPostBack" %>

<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
        <script type="text/javascript">
            // My javascript function reads like this for netscape interoperability: 
            function postbackOnCheck(e) {
                var isNav = (window.navigator.appName.toLowerCase().indexOf("netscape") >= 0);
                var o;
                if (isNav && e != null)
                    o = e.target;
                else
                    o = window.event.srcElement;

                if (o.tagName == 'INPUT' && o.type == 'checkbox'
            && o.name != null && o.name.indexOf('CheckBox') > -1)
                    __doPostBack("", "");
            }

            function postBack() {
                __doPostBack('', '');
            }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="TheScriptManager" runat="server" EnablePartialRendering="true"
        EnablePageMethods="true" />
    <div>
    
        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <contenttemplate>
            <asp:Literal ID="Literal1" runat="server"></asp:Literal>
            <asp:CheckBox ID="CheckBox1" runat="server" 
                onclick="javascript:postBack('CheckBox1');"
                oncheckedchanged="CheckBox1_CheckedChanged" />
            <asp:CheckBox ID="CheckBox2" runat="server" 
                onclick="javascript:__doPostBack('CheckBox2', '');"
                oncheckedchanged="CheckBox1_CheckedChanged" />

        </contenttemplate>
        </asp:UpdatePanel>
        

        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <contenttemplate>
                <asp:TreeView ID="TreeView1" runat="server" ExpandDepth="0" ShowLines="True" 
                    onclick="javascript:__doPostBack('', '');"
                    ontreenodecheckchanged="TreeView1_TreeNodeCheckChanged">
                    <Nodes>
                        <asp:TreeNode ShowCheckBox="True" Text="New Node" Value="New Node">
                        </asp:TreeNode>
                        <asp:TreeNode ShowCheckBox="True" Text="New Node" Value="New Node">
                        </asp:TreeNode>
                    </Nodes>
                </asp:TreeView>
            </contenttemplate>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>
